package dome5;

public class Text {
    public static void func2() {
        //匿名内部类,相当于实现接口
        new IA() {
            @Override
            public void testA() {
                System.out.println("testA()~~~");
            }
        }.testA();
    }
    public static void func1() {
        //匿名内部类,相当于继承Student
        new Student() {
            @Override
            public void test() {
                System.out.println("重写test()方法~~~");
            }
        }.test();//调用test()
    }

    public static void main(String[] args) {
        func1();
        func2();
    }
}
